import request from '@/config/axios'

export interface ServiceVO {
  id: number
  serviceName: string
  serviceCode: string
  serviceType: boolean
  description: string
  validDays: number
  menuIds: string
}

// 查询服务信息列表
export const getServicePage = async (params) => {
  return await request.get({ url: `/system/service/page`, params })
}

// 查询服务信息详情
export const getService = async (id: number) => {
  return await request.get({ url: `/system/service/get?id=` + id })
}

// 新增服务信息
export const createService = async (data: ServiceVO) => {
  return await request.post({ url: `/system/service/create`, data })
}

// 修改服务信息
export const updateService = async (data: ServiceVO) => {
  return await request.put({ url: `/system/service/update`, data })
}

// 删除服务信息
export const deleteService = async (id: number) => {
  return await request.delete({ url: `/system/service/delete?id=` + id })
}

// 导出服务信息 Excel
export const exportService = async (params) => {
  return await request.download({ url: `/system/service/export-excel`, params })
}
